// pages/nav/cms/nav_cms.js
const mybehavior = require("../../../behaviors/requests")
Page({

  /**
   * 页面的初始数据
   */
  behaviors: [mybehavior],
  data: {
    select_style: "width: 136rpx;height: 48rpx;background: #5555FF;border-radius: 24rpx 24rpx 24rpx 24rpx;opacity: 1;position: absolute;top: 108rpx;left: 28rpx;",
    tag_style1: "position: absolute;top: 114rpx;left: 48rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color:white;",
    tag_style2: "position: absolute;top: 114rpx;left: 196rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
    tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
    tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 120rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
    show11: true,
    show22: false,
    show33: false,
    show44: false,
    show55: false,
    baseUrl: "https://logisticsengineering.gree.com/container_manage_api/container_manage",
    total_task_count: 0,
    lailiao_task_count: 0,
    pssx_task_count: 0,
    WL_show: true,
    WL_show1: false,
    WL_word: "物流环节",
    bz_show: false,
    BZ_total_task_count: 0,

  },
  changeWL() {
    this.setData({
      WL_show1: true,
      WL_show: false,
      WL_word: "返回上级"
    })
  },
  changeBZ() {
    this.setData({
      WL_show1: false,
      WL_show: false,
      bz_show: true,
      WL_word: "返回上级"
    })
  },

  routeJump1(e) {
    console.log(e);
    let category = wx.getStorageSync('category')
    if (category != 'inner') {
      wx.showToast({
        title: '仅限格力内部员工使用！',
        icon: 'none'
      })
    } else {
      let key = e.currentTarget.dataset.row_data
      wx.navigateTo({
        url: key,
      })
    }


  },
  routeJump(e) {
    this.checkAuth(e)

  },
  routeJump111(e) {
    wx.showToast({
      title: '开发中,暂未开放!',
      icon:'none'
    })
  },
  // 标签切换
  tagChange1() {

    this.setData({
      show11: true,
      show22: false,
      bz_show: false,
      show33: false,
      show44: false,
      WL_show: true,
      WL_show1: false,
      WL_word: "物流环节",
      tag_style1: "position: absolute;top: 114rpx;left: 48rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color:white;",
      tag_style2: "position: absolute;top: 114rpx;left: 196rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 120rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      select_style: "width: 136rpx;height: 48rpx;background: #5555FF;border-radius: 24rpx 24rpx 24rpx 24rpx;opacity: 1;position: absolute;top: 108rpx;left: 28rpx;",
    })
  },
  tagChange2() {
    this.setData({
      show11: false,
      show22: true,
      show33: false,
      show44: false,
      tag_style1: "position: absolute;top: 114rpx;left: 48rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color: #666666;;",
      tag_style2: "position: absolute;top: 114rpx;left: 196rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color:white;",
      tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 120rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      select_style: "width: 136rpx;height: 48rpx;background: #5555FF;border-radius: 24rpx 24rpx 24rpx 24rpx;opacity: 1;position: absolute;top: 108rpx;left: 176rpx;",

    })
  },
  tagChange3() {
    this.setData({
      show11: false,
      show22: false,
      show33: true,
      show44: false,
      tag_style1: "position: absolute;top: 114rpx;left: 48rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style2: "position: absolute;top: 114rpx;left: 196rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color:white;",
      tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 120rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      select_style: "width: 136rpx;height: 48rpx;background: #5555FF;border-radius: 24rpx 24rpx 24rpx 24rpx;opacity: 1;position: absolute;top: 108rpx;left: 324rpx;",
    })
  },
  tagChange4() {
    this.setData({
      show11: false,
      show22: false,
      show33: false,
      show44: true,
      tag_style1: "position: absolute;top: 114rpx;left: 48rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style2: "position: absolute;top: 114rpx;left: 196rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style3: "position: absolute;top: 114rpx;left: 344rpx;width: 96rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;",
      tag_style4: "position: absolute;top: 114rpx;left: 492rpx;width: 120rpx;height: 36rpx;font-size: 24rpx;font-weight: 600;color: #666666;line-height: 36rpx;color:white;",
      select_style: "width: 160rpx;height: 48rpx;background: #5555FF;border-radius: 24rpx 24rpx 24rpx 24rpx;opacity: 1;position: absolute;top: 108rpx;left: 472rpx;",
    })
  },
  // 待办数据 
  getDataList1() {
    let url = "https://logisticsengineering.gree.com/pfep2_api/personal_task_manage/query_current_total_task"
    let data = {
      page_size: 9999,
      page: 1,
      query_cond: {}
    }
    this.post(url, data).then(res => {
      if (res.code == 20000) {



        this.setData({
          total_task_count: res.data.total,



        })
        // console.log("x", self.data.current_status1, self.data.current_status2, self.data.current_btn,);


      } else {
        // wx.showToast({
        //   title: res.msg,
        //   icon: "error"
        // })

      }
    }).catch(err => {

      this.setData({
        total_task_count: 0,



      })

      // wx.showToast({
      //   title: err.msg,
      //   icon: 'error'
      // })
    })
  },
  // 待办数据 
  getDataList1BZ() {
    let url = "https://logisticsengineering.gree.com/pfep2_api/personal_task_manage/query_current_total_task"
    let data = {
      page_size: 9999,
      page: 1,
      query_cond: {
        table_name: {
          $regex: 'service_all'
        }
      },
      database: "containers"
    }
    this.post(url, data).then(res => {
      if (res.code == 20000) {



        this.setData({
          BZ_total_task_count: res.data.total,



        })
        // console.log("x", self.data.current_status1, self.data.current_status2, self.data.current_btn,);


      } else {
        // wx.showToast({
        //   title: res.msg,
        //   icon: "error"
        // })

      }
    }).catch(err => {
      this.setData({
        BZ_total_task_count: 0,



      })
      // wx.showToast({
      //   title: err.msg,
      //   icon: 'error'
      // })
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.getDataList1()
    this.getDataList1BZ()
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },

})